﻿<div ng-controller="helpController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li>帮助中心</li>
            </ol>
        </div>
    </div>

    <form class="form-horizontal row">
       
        <div class="form-group">
            <div class="col-sm-3">
                <label class="col-sm-5 control-label">标题</label>
                <div class="col-sm-7">
                    <input name="title" type="text" class="form-control input-sm" ng-model="query.title">
                </div>
            </div>
            <div class="col-sm-3">
                <label class="col-sm-4 control-label">状态</label>
                <div class="col-sm-8">
                    <div class="col-sm-12">
                        <select name="status" class="form-control input-sm" ng-model="query.is_highlight">
                            <option value="">请选择</option>
                            <option value="true">正常</option>
                            <option value="false">隐藏</option>
                           
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <label class="col-sm-3 control-label">时间</label>
                <div class="col-sm-9">
                    <div date class="input-group date">
                        <input class="form-control input-sm" ng-model="query.start_time">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>

                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <label class="col-sm-1 control-label">至</label>
                <div class="col-sm-9">
                    <div date class="input-group date">
                        <input class="form-control input-sm" ng-model="query.end_time">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-4">
                <div class="col-sm-offset-4 col-sm-8">
                    <button class="btn btn-primary btn-sm" ng-click="search()"><i class="fa fa-search"></i> 查询</button>
                    <button class="btn btn-primary btn-sm" ui-sref="app.help.detail()"><i class="fa fa-plus"></i> 添加</button>
                </div>
            </div>
        </div>
    </form>
    <table style="table-layout:fixed;" class="table table-hover m-t-md">
        <thead>
            <tr style="background-color: #f7f7f9;">
                <th>序号</th>
             
                <th>标题</th>
                <th>描述</th>
                <th>更新时间时间</th>
              
                <th>是否推荐</th>
                <th>状态</th>
                <th>点击数</th>
             
                <th width="130">操作</th>
            </tr>
        </thead>
        <tbody ng-repeat="item in model.rows">
            <tr>
                <td>{{$index+1}}</td>
             
                <td style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-height:30px;width:100%;">{{item.title}}</td>
                <td style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-height:30px;width:100%;display:inline-block;"><span ng-bind-html="item.description == null ? '' : item.description"></span></td>
                <td>{{item.create_time}}</td>
                <!--<td style="{{item.status == 1 ? 'color:#337ab7':item.status == 2 ? 'color:#d3d3d3':''}}">{{item.status == 1? '正常':'已删除'}}</td>-->
                <td style="{{item.is_top == true ? 'color:#337ab7':item.status == 2 ? 'color:#d3d3d3':''}}">{{item.is_top == false ? '未推荐':'已推荐'}}</td>
                <td style="{{item.is_highlight == true ? 'color:#337ab7':item.status == 2 ? 'color:#d3d3d3':''}}">{{item.is_highlight == false ? '隐藏' : '正常'}}</td>
                <td>{{item.click_num}}</td>
              
                <td>
                    <a ng-if="item.status == 1" class="btn btn-primary btn-xs" href="javascript:void(0);" ng-click="delete(item.id)"><i class="fa fa-cog"></i>删除</a>
                    <a class="btn btn-primary btn-xs" ui-sref="app.help.detail({id:{{item.id}}})"><i class="fa fa-cog"></i>编辑</a>
                    <a class="btn btn-primary btn-xs" ng-if="item.is_highlight == false" ng-click="quality(item.id,true)"><i class="fa fa-cog"></i>显示</a>
                    <a class="btn btn-primary btn-xs" ng-if="item.is_highlight == true" ng-click="quality(item.id,false)"><i class="fa fa-cog"></i>隐藏</a>
                    <a class="btn btn-primary btn-xs" ng-if="item.is_top == false" ng-click="top(item.id,true)"><i class="fa fa-cog"></i>推荐</a>
                    <a class="btn btn-primary btn-xs" ng-if="item.is_top == true" ng-click="top(item.id,false)"><i class="fa fa-cog"></i>取消推荐</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-md-12">
            <uib-pagination total-items="model.total_result" items-per-page="model.size" ng-model="model.page" num-pages="model.total_pages"
                            ng-change="search_page(model.page, 1)" class="pagination-sm" boundary-links="true" boundary-link-numbers="true" max-size="20"
                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
            <span class="pull-right" style="margin: 30px 0px 20px 0px">共{{model.total_result}} 当前：{{model.page}}/{{model.total_pages}}</span>
        </div>
    </div>
</div>
